package com.framework.model.common;

import com.framework.common.annotation.QueryParam;
import com.framework.common.model.validation.ValidationGroup;
import com.framework.model.base.BaseModel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.model.common.District
 * @title 地区类
 * @datetime 2024-05-13 11:25:40
 */
public class District extends BaseModel implements Serializable {
    /**
     * 等级 LEVEL
     */
//    @NotNull(message = "请选择等级", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Min(message = "等级错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Max(message = "等级错误", value = Integer.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "level", code = "p.LEVEL")
    private Integer level;

    /**
     * 上级区划编码 PARENT_CODE
     */
//    @NotBlank(message = "请输入上级区划编码", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Size(message = "上级区划编码最多255字符", max = 255, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "parentCode", code = "p.PARENT_CODE")
    private String parentCode;

    /**
     * 区划编码 CODE
     */
//    @NotBlank(message = "请输入区划编码", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Size(message = "区划编码最多255字符", max = 255, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "code", code = "p.CODE")
    private String code;

    /**
     * 区划名称 NAME
     */
    @NotBlank(message = "请输入区划名称", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Size(message = "区划名称最多255字符", max = 255, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "name", code = "p.NAME")
    private String name;

    /**
     * 地区全拼音 PIN_YIN
     */
//    @NotBlank(message = "请输入地区全拼音", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Size(message = "地区全拼音最多512字符", max = 512, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "pinYin", code = "p.PIN_YIN")
    private String pinYin;

    /**
     * 区域第一个字的首字母 INITIAL
     */
//    @NotBlank(message = "请输入区域第一个字的首字母", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Size(message = "区域第一个字的首字母最多8字符", max = 8, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "initial", code = "p.INITIAL")
    private String initial;

    /**
     * 地区拼音首字母 PIN_YIN_ACRONYM
     */
//    @NotBlank(message = "请输入地区拼音首字母", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
//    @Size(message = "地区拼音首字母最多32字符", max = 32, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "pinYinAcronym", code = "p.PIN_YIN_ACRONYM")
    private String pinYinAcronym;

    /**
     * t_district
     */
    private static final long serialVersionUID = 1L;

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode == null ? null : parentCode.trim();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getPinYin() {
        return pinYin;
    }

    public void setPinYin(String pinYin) {
        this.pinYin = pinYin == null ? null : pinYin.trim();
    }

    public String getInitial() {
        return initial;
    }

    public void setInitial(String initial) {
        this.initial = initial == null ? null : initial.trim();
    }

    public String getPinYinAcronym() {
        return pinYinAcronym;
    }

    public void setPinYinAcronym(String pinYinAcronym) {
        this.pinYinAcronym = pinYinAcronym == null ? null : pinYinAcronym.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", level=").append(level);
        sb.append(", parentCode=").append(parentCode);
        sb.append(", code=").append(code);
        sb.append(", name=").append(name);
        sb.append(", pinYin=").append(pinYin);
        sb.append(", initial=").append(initial);
        sb.append(", pinYinAcronym=").append(pinYinAcronym);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        District other = (District) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCreateId() == null ? other.getCreateId() == null : this.getCreateId().equals(other.getCreateId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getOperaterId() == null ? other.getOperaterId() == null : this.getOperaterId().equals(other.getOperaterId()))
            && (this.getOperaterTime() == null ? other.getOperaterTime() == null : this.getOperaterTime().equals(other.getOperaterTime()))
            && (this.getOperaterStatus() == null ? other.getOperaterStatus() == null : this.getOperaterStatus().equals(other.getOperaterStatus()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getParentCode() == null ? other.getParentCode() == null : this.getParentCode().equals(other.getParentCode()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPinYin() == null ? other.getPinYin() == null : this.getPinYin().equals(other.getPinYin()))
            && (this.getInitial() == null ? other.getInitial() == null : this.getInitial().equals(other.getInitial()))
            && (this.getPinYinAcronym() == null ? other.getPinYinAcronym() == null : this.getPinYinAcronym().equals(other.getPinYinAcronym()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCreateId() == null) ? 0 : getCreateId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getOperaterId() == null) ? 0 : getOperaterId().hashCode());
        result = prime * result + ((getOperaterTime() == null) ? 0 : getOperaterTime().hashCode());
        result = prime * result + ((getOperaterStatus() == null) ? 0 : getOperaterStatus().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getParentCode() == null) ? 0 : getParentCode().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPinYin() == null) ? 0 : getPinYin().hashCode());
        result = prime * result + ((getInitial() == null) ? 0 : getInitial().hashCode());
        result = prime * result + ((getPinYinAcronym() == null) ? 0 : getPinYinAcronym().hashCode());
        return result;
    }
}